
#include<iostream>
#include<stack>
#include<queue>
using namespace std;



int test2()

{

    queue<char> Q;

    char x, y;

    x = 'n'; y = 'g';

    Q.push(x); Q.push('i'); Q.push(y);//nig

    Q.pop(); Q.push('r'); Q.push('t'); Q.push(x);//igrtn

    Q.pop(); Q.push('s');//grtns

    while (!Q.empty())

    {

        x = Q.front();

        Q.pop();

        cout << x;

    };

    cout << y;

}
int test1()

{

    stack<char> S;

    char x, y;

    x = 'n'; y = 'g';

    S.push(x); S.push('i'); S.push(y);//nig

    S.pop(); S.push('r'); S.push('t'); S.push(x);//nirts

    S.pop(); S.push('s');//strin

    while (!S.empty())

    {

        x = S.top();

        S.pop();

        cout << x;
    };


    cout << y;

    return 0;
}

int test2()

{
    priority_queue<int> a;
    priority_queue<int, vector<int>, greater<int> > c;
    priority_queue<string> b;
    for (int i = 0; i < 5; i++)
    {
        a.push(i);
       c.push(i);
    }
    while (!a.empty())
    {
        cout << a.top() << ' ';
        a.pop();
    }//54321
    while (!c.empty())
    {
        cout << c.top() << ' ';
        c.pop();
    }//12345
    cout << endl;
    b.push("abc");
    b.push("abcd");
    b.push("cbd");
    while (!b.empty())
    {
        cout << b.top() << ' ';
        b.pop();
    }//
    cout << endl;
    return 0;

}